// sysModel.js
const Base = require('../base.js');
// https://testjoylearning.bmw.com.cn:8080/sys/storeApprove/list?pageNo=1&pageSize=10
module.exports = function(sequelize, DataTypes) {
    function getAttributes(sequelize, DataTypes) {
        const attributes = {
            valDetailId: {
                field: "val_detail_id",
                type: DataTypes.BIGINT(20),
                primaryKey: true,
                comment: "值列表清单ID"
            },
            valCode: {
                field: "val_code",
                type: DataTypes.STRING(50),
                allowNull: false,
                comment: "值列表编码"
               
            },
            val: {
                field: "val",
                type: DataTypes.STRING(50),
                allowNull: false,
                comment: "值"
               
            },
            text: {
                field: "text",
                type: DataTypes.STRING(200),
                allowNull: false,
                comment: "文本"
               
            },
            orderNo: {
                field: "order_no",
                type: DataTypes.BIGINT(11),
                allowNull: true,
                comment: "排序码",
            },
            ...Base.getAttr(sequelize, DataTypes)
            
            
        };
        return attributes;
    };
    const sysValueDetails = sequelize.define('sysValueDetails', getAttributes(sequelize, DataTypes), {
        freezeTableName: true,
        tableName: "sys_value_details",
        timestamps: false
    });
    
    Base.extendModel(sysValueDetails, getAttributes(sequelize, DataTypes));
    return sysValueDetails;
};